<template>
  <div>
    <h2 ref="title">啊哈哈哈</h2>
  </div>
</template>

<script>
import {ref, watchEffect} from 'vue'
export default {
  setup(){
    const title = ref(null);

    watchEffect(() => {
      console.log(title.value)
    },{
      //挂载完之后再执行
       flush:"post"
    })

    return{
      title
    }
  }
}
</script>

<style scoped>

</style>